package main

import "fmt"
import "reflect"

func main() {
	m := make(map[string]interface{})
	m["a"] = []string{"a", "b", "c"}
	m["b"] = [4]int{1, 2, 3, 4}

	test(m)


	rt := reflect.TypeOf(m["a"])
	fmt.Println(rt.Elem())
}

func test(m map[string]interface{}) {
	for k, v := range m {
		rt := reflect.TypeOf(v)
		switch rt.Kind() {
		case reflect.Slice:
			fmt.Println(k, "is a slice with element type", rt.Elem())
		case reflect.Array:
			fmt.Println(k, "is an array with element type", rt.Elem())
		default:
			fmt.Println(k, "is something else entirely")
		}
	}
}

func Where(args ...interface{}) interface{} {
	//var tmp string
	// 查看args的长度
	var argArr []interface{}
	for _, arg := range args {
		argArr = append(argArr, arg)
	}
	argLen := len(argArr)
	switch argLen {
	case 1:

	case 2:
		switch argArr[1].(type) {
		case string:
			fmt.Println("yes")
		default:
			fmt.Println("no")
		}
		//tmp = argArr[0]+" = "+strconv.Itoa(argArr[1])
	case 3:
	}

	return argArr
}

func getTypess(param interface{}) string {
	var data string
	switch param.(type) {
	case int:
		data = "int"
	case string:
		data = "string"
	case []:
		data = "array"
	case map[string]interface{}:
		data = "map"
	case []map[string]interface{}:
		data = "array_map"
	default:
		data = "none"
	}

	return data
}
